<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">
<head th:replace="_header_include::frag(~{::title},~{::link},~{})">
    <title>我的工作台-商务总监</title>
    <link rel="stylesheet" th:href="@{/css/custom/console/console.css}">
</head>
<body>
<div id="mainDiv"  class="mainPadding consoleStyle" style="display: none;">
    <!-- 工作台 -->
    <el-breadcrumb separator="/" class="elBreadcrumb marginB20">
        <el-breadcrumb-item>Home</el-breadcrumb-item>
        <el-breadcrumb-item>商务管理</el-breadcrumb-item>
        <el-breadcrumb-item>我的工作台</el-breadcrumb-item>
    </el-breadcrumb>
    <el-row><!--{{totalPerformance == null or totalPerformance == 0 ? 1 : totalPerformance}}-->
        <div class="tip">感谢您辛苦工作的第<em>{{workDay}}</em>天，
            累计业绩达<em>{{totalPerformance == null || totalPerformance == 0.00 ? '--' : formatNum(totalPerformance)}}</em>元，继续努力！</div>
        <!-- 系统公告 -->
        <div class="affiche marginB20" v-if="afficheBox">
            <span class="f-fl"><img th:src="@{/images/icon_notice.png}" alt="" class="f-fl" style="margin-right: 10px;">系统公告：</span>  
            <div class="f-fl" style="width: 86%;">
                <marquee onmouseover="this.stop()" onmouseout="this.start()">
                    <span style="margin-right: 50px;" v-for="item in items" :key="item.id">{{ item.content }}</span>                
                </marquee> 
            </div>                     
        </div>
        <!-- <div class="title">
            <div class="leftbox f-fl"><img th:src="@{/images/icon_kb.png}" alt="" class="f-fl">数字看板</div>
        </div> -->
        <ul class="board board3">
            <li class="border_wraper">
                <div class="wraper_li bg1 bg11">
                    <div class="toptitle">今日首访数</div>
                    <div v-if="dayFirstVisit != 0 && dayFirstVisit != null" class="con">{{dayFirstVisit}}</div>
                    <div v-else class="con">--</div>
                </div>
                <div class="wraper_li f-fr bg2 bg22">
                    <div class="toptitle">待分配任务数</div>
                    <div v-if="waitAllotNum !=0 && waitAllotNum != null" class="con">{{waitAllotNum}}</div>
                    <div v-else class="con">--</div>
                </div>
                <div class="wraper_li bg3 bg33">
                    <div class="toptitle">今日签约数</div>
                    <div v-if="daySign != 0 && daySign != null" class="con">{{daySign}}</div>
                    <div v-else class="con">--</div>
                </div>
                <div class="wraper_li f-fr bg1 bg11">
                    <div class="toptitle">预计明日来访数</div>
                    <div v-if="tomorrowFirstVisit != 0 && tomorrowFirstVisit != null" class="con">{{tomorrowFirstVisit}}</div>
                    <div v-else class="con">--</div>
                </div>
            </li>
            <li class="border_wraper">
                <div class="wraper_dl f-fl">
                    <p class="top_title"><em></em>当月签约率</p>
                    <el-progress type="circle" :percentage="monthSignRate == null ? 0.00 : monthSignRate " :stroke-width="20" :width="168" color="#697df5"></el-progress>
                </div>
                <div class="wraper_dl f-fl">
                    <p class="top_title"><em></em>当月首访签约率</p>
                    <el-progress type="circle" :percentage="monthFirstvisitSignrate == null ? 0.00 : monthFirstvisitSignrate " :stroke-width="20" :width="168" color="#a978f5">{{monthFirstvisitSignrate}}</el-progress>
                </div>
                <div class="wraper_dl f-fl">
                    <p class="top_title"><em></em>当月全款率</p>
                    <el-progress type="circle" :percentage="monthFullPaymentRate == null ? 0.00 : monthFullPaymentRate " :stroke-width="20" :width="168" color="#32c3bf">{{monthFullPaymentRate}}</el-progress>
                </div>
            </li>
        </ul>
        <ul class="board board3">
            <li class="boardStyle2 bgColor1">
                <div class="cnt">
                    <div class="f-fl">
                        <div class="toptitle">当月二次来访数</div>
                        <!-- <div class="con">{{secondVisitedNum}}</div> -->
                        <div class="con">{{monthSecondVisit == null || monthSecondVisit == 0 ? '--' : monthSecondVisit}}</div>
                    </div>
                    <div class="f-fr"><img th:src="@{/images/icon_jrsfs.png}" alt=""></div>
                </div>
            </li>
            <li class="boardStyle2 bgColor2">
                <div class="cnt">
                    <div class="f-fl">
                        <div class="toptitle">当月二次来访签约数</div>
                        <!-- <div class="con">{{secondSignedNum}}</div> -->
                        <div class="con">{{monthSecondVisitSign == null || monthSecondVisitSign == 0 ? '--' : monthSecondVisitSign}}</div>
                    </div>
                    <div class="f-fr"><img th:src="@{/images/icon_jrqys.png}" alt=""></div>
                </div>
            </li>
            <li class="boardStyle2 bgColor3">
                <div class="cnt">
                    <div class="f-fl">
                        <div class="toptitle">未收齐尾款笔数</div>
                        <div class="con">{{noTailSign == null || noTailSign == 0 ? '--' : noTailSign}}</div>
                    </div>
                    <div class="f-fr"><img th:src="@{/images/icon_payment.png}" alt=""></div>
                </div>
            </li>
            <li class="boardStyle2 bgColor4">
                <div class="cnt">
                    <div class="f-fl">
                        <div class="toptitle">未收齐尾款金额</div>
                        <div class="con">{{noTailAmount == null || noTailAmount == 0.00 ? '--' : formatNum(noTailAmount)}}<em>元</em></div>
                    </div>
                    <div class="f-fr"><img th:src="@{/images/icon_payment.png}" alt=""></div>
                </div>
            </li>
            <li class="boardStyle2 bgColor5">
                <div class="cnt">
                    <div class="f-fl">
                        <div class="toptitle">累计服务客户数</div>
                        <div class="con">{{totalCustomer == null || totalCustomer == 0 ? '--' : totalCustomer}}</div>
                    </div>
                    <div class="f-fr"><img th:src="@{/images/icon_customer.png}" alt=""></div>
                </div>
            </li>
        </ul>
        <div class="boardTabList">
            <el-tabs v-model="activeName" @tab-click="handleClick">
                <el-tab-pane label="当月" name="1">
                    <ul class="tabUl">
                        <li class="tabLi1">
                            <img th:src="@{/images/icon_achievement.png}" alt="">
                            <div class="name">业绩</div>
                            <div class="num"><span>{{monthPerformance == null || monthPerformance == 0 ? '--' : formatNum(monthPerformance)}}</span><em>元</em></div>
                            <div class="line"></div>
                        </li>
                        <li class="tabLi2">
                            <img th:src="@{/images/icon_ranking.png}" alt="">
                            <div class="name">大区排名</div>
                            <div class="num">第<span>{{monthAreaRank == null || monthAreaRank == 0 ? '--' : monthAreaRank}}</span>名</div>
                            <div class="line"></div>
                        </li>
                        <li class="tabLi3">
                            <img th:src="@{/images/icon_gspm.png}" alt="">
                            <div class="name">公司排名</div>
                            <div class="num">第<span>{{monthCompanyRank == null || monthCompanyRank == 0 ? '--' : monthCompanyRank}}</span>名</div>
                            <div class="line"></div>
                        </li>
                        <li class="tabLi4">
                            <img th:src="@{/images/icon_disparity.png}" alt="">
                            <div class="name">距大区上一名业绩差</div>
                            <div class="num"><span>{{monthAreaPerformanceDifference == null || monthAreaPerformanceDifference == 0.00 ? '--' : formatNum(monthAreaPerformanceDifference)}}</span><em>元</em></div>
                            <div class="line"></div>
                        </li>
                        <li class="tabLi5">
                            <img th:src="@{/images/icon_yjc.png}" alt="">
                            <div class="name">距公司上一名业绩差</div>
                            <div class="num"><span>{{monthCompanyPerformanceDifference == null || monthCompanyPerformanceDifference == 0.00 ? '--' : formatNum(monthCompanyPerformanceDifference)}}</span><em>元</em></div>
                        </li>
                    </ul>
                </el-tab-pane>
                <el-tab-pane label="季度" name="2">
                    <ul class="tabUl">
                        <li class="tabLi1">
                            <img th:src="@{/images/icon_achievement.png}" alt="">
                            <div class="name">业绩</div>
                            <div class="num"><span>{{quarterPerformance == null || quarterPerformance == 0.00 ? '--' : formatNum(quarterPerformance)}}</span><em>元</em></div>
                            <div class="line"></div>
                        </li>
                        <li class="tabLi2">
                            <img th:src="@{/images/icon_ranking.png}" alt="">
                            <div class="name">大区排名</div>
                            <div class="num">第<span>{{quarterAreaRank == null || quarterAreaRank == 0 ? '--' : quarterAreaRank}}</span>名</div>
                            <div class="line"></div>
                        </li>
                        <li class="tabLi3">
                            <img th:src="@{/images/icon_gspm.png}" alt="">
                            <div class="name">公司排名</div>
                            <div class="num">第<span>{{quarterCompanyRank == null || quarterCompanyRank == 0 ? '--' : quarterCompanyRank}}</span>名</div>
                            <div class="line"></div>
                        </li>
                        <li class="tabLi4">
                            <img th:src="@{/images/icon_disparity.png}" alt="">
                            <div class="name">距大区上一名业绩差</div>
                            <div class="num"><span>{{quarterAreaPerformanceDifference == null || quarterAreaPerformanceDifference == 0.00 ? '--' : formatNum(quarterAreaPerformanceDifference)}}</span><em>元</em></div>
                            <div class="line"></div>
                        </li>
                        <li class="tabLi5">
                            <img th:src="@{/images/icon_yjc.png}" alt="">
                            <div class="name">距公司上一名业绩差</div>
                            <div class="num"><span>{{quarterCompanyPerformanceDifference == null || quarterCompanyPerformanceDifference == 0.00 ? '--' : formatNum(quarterCompanyPerformanceDifference)}}</span><em>元</em></div>
                        </li>
                    </ul>
                </el-tab-pane>
                <el-tab-pane label="年度" name="3">
                    <ul class="tabUl">
                        <li class="tabLi1">
                            <img th:src="@{/images/icon_achievement.png}" alt="">
                            <div class="name">业绩</div>
                            <div class="num"><span>{{yearPerformance == null || yearPerformance == 0.00 ? '--' : formatNum(yearPerformance)}}</span><em>元</em></div>
                            <div class="line"></div>
                        </li>
                        <li class="tabLi2">
                            <img th:src="@{/images/icon_ranking.png}" alt="">
                            <div class="name">大区排名</div>
                            <div class="num">第<span>{{yearAreaRank == null || yearAreaRank == 0 ? '--' : yearAreaRank}}</span>名</div>
                            <div class="line"></div>
                        </li>
                        <li class="tabLi3">
                            <img th:src="@{/images/icon_gspm.png}" alt="">
                            <div class="name">公司排名</div>
                            <div class="num">第<span>{{yearCompanyRank == null || yearCompanyRank == 0 ? '--' : yearCompanyRank}}</span>名</div>
                            <div class="line"></div>
                        </li>
                        <li class="tabLi4">
                            <img th:src="@{/images/icon_disparity.png}" alt="">
                            <div class="name">距大区上一名业绩差</div>
                            <div class="num"><span>{{yearAreaPerformanceDifference == null || yearAreaPerformanceDifference == 0.00 ? '--' : formatNum(yearAreaPerformanceDifference)}}</span><em>元</em></div>
                            <div class="line"></div>
                        </li>
                        <li class="tabLi5">
                            <img th:src="@{/images/icon_yjc.png}" alt="">
                            <div class="name">距公司上一名业绩差</div>
                            <div class="num"><span>{{yearCompanyPerformanceDifference == null || yearCompanyPerformanceDifference == 0.00 ? '--' : formatNum(yearCompanyPerformanceDifference)}}</span><em>元</em></div>
                        </li>
                    </ul>
                </el-tab-pane>
            </el-tabs>
        </div>
        <!-- 消息提醒 -->
        <dialog-console :param="consoleNewsParam"></dialog-console>      
    </el-row>
    <!-- 工作台结束 -->
    <!-- 待分配邀约来访记录 -->
    <el-row class="marginB20">
        <div class="title">
            <div class="leftbox f-fl">待分配邀约来访记录</div>
            <div class="rightbox f-fr">
                <img th:src="@{/images/icon_arrow.png}" alt="" class="f-fr">
                <span class="f-fr" @click="gotoBusAllocation">进入待分配来访客户</span>
                <shiro:hasPermission name="business:busAllocationManager:cancel">
	                <el-button type="primary" size="small"  class="f-fr btn" @click="openCancelForm">标记取消</el-button>
			    </shiro:hasPermission>
                <el-button type="primary" size="small"  class="f-fr btn" @click="toAllocationClue">快速分配资源</el-button>
            </div>
        </div>
        <el-row class="mainWhiteBg mainWhitePadding">
            <el-table  ref="multipleTable" tooltip-effect="dark" border @row-dblclick="showCustomerDetail" @selection-change="handleSelectionChange"
                style="width: 100%"  :data="dataTable">
               <el-table-column align="center" type="selection" label="全选" width="55"></el-table-column>
               <el-table-column align="center" type="index" label="序号" width="55"></el-table-column>
               <el-table-column align="center" prop="createTime" label="提交邀约时间" sortable :formatter="dateFormat" width="130"></el-table-column>
               <el-table-column align="center" prop="reserveTime" label="邀约来访时间" sortable :formatter="dateFormat" width="130"></el-table-column>
               <el-table-column align="center" prop="teleGorupName" label="电销组" width="100"></el-table-column>
               <el-table-column align="center" prop="teleDirectorName" label="电销总监" width="120"></el-table-column>
               <el-table-column align="center" prop="teleSaleName" label="电销顾问" width="120"></el-table-column>
               <el-table-column align="center" prop="accountPhone" label="电销顾问电话"  width="120"></el-table-column>
               <el-table-column align="center" prop="teleProjectId" label="电销组项目"  width="120"></el-table-column>
               <el-table-column align="center" prop="cusName" label="客户姓名" width="130"></el-table-column>
               <el-table-column align="center" prop="tasteProjectId" label="考察项目" width="130" :formatter="transformProject"></el-table-column>
               <!-- <el-table-column align="center" prop="" label="签约店型" :formatter="transformProject"></el-table-column> -->
               <el-table-column align="center" prop="province" label="开店省份" width="100"></el-table-column>
               <el-table-column align="center" prop="hasAddress" label="选址情况" width="100" :formatter="transformAddress"></el-table-column>
               <el-table-column align="center" prop="advanceAmount" label="预投金额" width="100" :formatter="transformUssm"></el-table-column>
               <el-table-column align="center" prop="purProjectType" label="意向项目" width="130" :formatter="transformPurProject" ></el-table-column>
               <el-table-column align="center" prop="area" label="店面面积" width="100" :formatter="transformArea"></el-table-column>
            </el-table>
        </el-row>
        <!-- 分发资源 -->
        <el-dialog  title="分发资源"  :visible.sync="allocationVisible" width="540px" @close="allocationCloseDialog">
            <template>
                <el-form :model="allocationForm" ref="allocationForm" :rules="allocationFormRules">
                    <el-form-item >
                        {{allocationForm.message}}
                    </el-form-item>
                    <el-form-item label="商务经理："    
                        :label-width="formLabelWidth"  
                        prop="saleId"
                        :rules="[
                            { required: true, message: '商务经理不能为空'},
                        ]"
                        >
                        <el-select v-model="allocationForm.saleId" placeholder="组内商务经理姓名" style="width: 290px;" filterable>
                            <el-option v-for="item in saleOptions" 
                                :key="item.id" 
                                :label="item.name" 
                                :value="item.id">
                            </el-option>
                        </el-select>
                        <el-button type="text" @click="showSaleIdOther" size="mini">
                            <i v-if="!isSaleIdOther" class="el-icon-plus"/></i>
                            <i v-if="isSaleIdOther" class="el-icon-minus"/></i>
                            辅助经理
                        </el-button>
                    </el-form-item>
                    <el-form-item label="辅助商务经理:" :label-width="formLabelWidth" prop="" style="margin-bottom: 20px;" v-if="isSaleIdOther">
                        <el-select v-model="allocationForm.saleIdOther" placeholder="组内商务经理姓名" style="width: 290px;margin-right: 10px;" filterable>
                            <el-option v-for="item in saleOptions" :key="item.id" :label="item.name"
                                       :value="item.id"></el-option>
                        </el-select>
                        <p style="position: absolute;bottom: -25px;color: #f56c6c;">增加辅助商务经理后，签约后两个商务经理将平分业绩</p>
                    </el-form-item>
                    <el-form-item label="备注：" :label-width="formLabelWidth"  prop="remark">
                        <el-input type="textarea" v-model="allocationForm.remark" class="input-with-select" maxlength="200" style="width: 290px;" :rows="4" placeholder="输入分发备注"></el-input>
                    </el-form-item>
                </el-form>
                <div slot="footer" class="dialog-footer">
                    <el-button type="primary" @click="allocationClue('allocationForm')" :disabled="confirmBtnDisabled">提 交</el-button>
                    <el-button  @click="allocationClueCancel('allocationForm')">取 消</el-button>
                </div>
            </template>
        </el-dialog>
        <!-- 标记取消-->
	  <el-dialog title="取消原因"    :visible.sync="cancelFormVisible" width="540px">
	    <el-form :model="cancelDigForm" ref="cancelDigForm" :rules="cancelRules">
	      <el-row>
	        <div class="marginB10" style="padding-left: 150px;">确认标记取消选中的邀约来访？</div>
	        <el-form-item label="取消原因：" :label-width="formLabelWidth" prop="cancelReason">
	          <el-input type="textarea" :rows="3" v-model="cancelDigForm.cancelReason" autocomplete="off" maxlength="100" placeholder="100字" style="width: 80%;"></el-input>
	        </el-form-item>
	      </el-row>
	    </el-form>
	    <div slot="footer" class="dialog-footer">
	      <el-button type="primary" @click="submitCancelForm('cancelDigForm')">提 交</el-button>
	      <el-button @click="cancelFormVisible= false" >取 消</el-button>
	    </div>
	  </el-dialog>
    </el-row>
    <!-- 待分配邀约来访记录 end-->
    <!-- 待审批到访 -->
    <el-row class="marginB20">
        <div class="title">
            <div class="leftbox f-fl">待审批到访记录</div>
            <div class="rightbox f-fr">
                <img th:src="@{/images/icon_arrow.png}" alt="" class="f-fr">
                <span class="f-fr" @click="gotoVisitRecord">进入客户到访记录</span>
                <el-button type="success" size="small" class="f-fr btn" @click="passVisit">审核通过</el-button>
                <el-button type="danger" size="small" class="f-fr btn" @click="OpenRejectVisitRecordDialog">驳回</el-button>
            </div>
        </div>
        <div class="mainWhiteBg mainWhitePadding">
            <el-table 
                ref="dataTable2"
                tooltip-effect="dark"
                style="width: 100%"
                border
                @selection-change="handleSelectionChange2"
                :data="dataTable2" 
                >
                <el-table-column align="center" type="selection" width="55"></el-table-column>
                <el-table-column align="center" prop="serialNum" label="序号" width="55"></el-table-column>
                <el-table-column align="center" prop="customerName" label="客户姓名" width="130"></el-table-column>  
                <el-table-column align="center" prop="projectName" label="考察项目" width="100"></el-table-column>
                <el-table-column align="center" prop="companyName" label="考察公司" width="100"></el-table-column>
                <el-table-column align="center" prop="vistitTime" label="到访时间" width="130"></el-table-column>
                <el-table-column align="center" prop="vistitStoreTypeName" label="到访店铺类型" width="100"></el-table-column>
                <el-table-column align="center" prop="visitType" label="到访类型" :formatter="getVisitTypeText" width="90"></el-table-column>
                <el-table-column align="center" prop="arrVisitCity" label="到访城市" width="100"></el-table-column>
                <el-table-column align="center" prop="signProvince" label="预签约省份" width="100"></el-table-column> 
                <el-table-column align="center" prop="signCity" label="预签约城市" width="100"></el-table-column>   
                <el-table-column align="center" prop="signDistrict" label="预签约区／县" width="100"></el-table-column>
                <el-table-column align="center" prop="businessGroupName" label="商务小组" width="100"></el-table-column> 
                <el-table-column align="center" prop="businessManagerName" label="商务经理" width="120"></el-table-column>
                <el-table-column align="center" prop="teleGroupName" label="电销组" width="100"></el-table-column> 
                <el-table-column align="center" prop="teleSaleName" label="电销顾问" width="120"></el-table-column>
                <el-table-column align="center" prop="isSign" label="是否签约" width="100">
                    <template slot-scope="scope">
                        <span v-if="scope.row.isSign===0">
                            否&nbsp;<el-button @click="notSignedReasonClick(scope.row)" type="text">未签约原因</el-button>
                        </span>
                        <span v-else-if="scope.row.isSign===1">是</span>
                    </template>
                </el-table-column>
                <el-table-column align="center" prop="createTime" label="创建时间" width="130"></el-table-column> 
                <el-table-column align="center" prop="visitNum" label="到访次数" :formatter="getVisitNumText" width="90">
                </el-table-column>
                <el-table-column align="center" prop="status" label="到访有效性" width="100">
                    <template slot-scope="scope">
                        <span v-if="scope.row.status===0">
                            驳回&nbsp;<el-button @click="reasonClick(scope.row)" type="text">驳回原因</el-button>
                        </span>
                        <span v-else-if="scope.row.status===1">待审核</span>
                        <span v-else-if="scope.row.status===2">有效</span> 
                    </template>
                </el-table-column>
            </el-table>
        </div>
        <!-- 驳回处理 -->
        <el-dialog title="提示" :visible.sync="dialogFormVisibleVisit" width="540px">
            <el-form :model="dialogForm" ref="dialogForm" :rules="dialogRules">
                <div class="fs16 marginB20">确定要将此 {{signRecordArrTitle}} 到访记录驳回吗？</div>
                <el-form-item label="驳回原因：" label-width="100px" prop="reason">
                    <el-input
                        type="textarea"
                        :rows="4"
                        placeholder="请输入驳回原因"
                        maxLength="100"
                        v-model="dialogForm.reason">
                    </el-input>
                </el-form-item>
                <div class="f-tar">最多100字</div>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button type="primary" @click="submitDialogFormVisit('dialogForm')" :disabled="btnDisabled">确 定</el-button>
                <el-button @click="dialogFormVisibleVisit = false" >取 消</el-button>
            </div>
        </el-dialog>
        <!-- 未签约原因 -->
        <el-dialog title="未签约原因" :visible.sync="notSignedReasonDialog">         
            <div class="fs16 marginB20" >{{notSignReason}}</div>
        </el-dialog>
    </el-row>
    <!-- 待审批到访 end -->
    <!-- 待审批未到访记录 -->
    <el-row class="marginB20">
        <div class="title">
            <div class="leftbox f-fl">待审批未到访记录</div>
            <div class="rightbox f-fr">
                <img th:src="@{/images/icon_arrow.png}" alt="" class="f-fr">
                <span class="f-fr" @click="gotoNoVisitRecord">进入客户未到访记录</span>
                <el-button type="success" size="small" class="f-fr btn" @click="passUnVisit">审核通过</el-button>
                <el-button type="danger" size="small" class="f-fr btn" @click="OpenRejectUnVisitRecordDialog">驳回</el-button>
            </div>
        </div>
        <div class="mainWhiteBg mainWhitePadding">
            <el-table 
                ref="dataTable3"
                tooltip-effect="dark"
                style="width: 100%"
                border
                @selection-change="handleSelectionChange3"
                :data="dataTable3" 
                >
                <el-table-column align="center" type="selection" width="55"></el-table-column>
                <el-table-column align="center" type="index" label="序号" width="55"></el-table-column>
                <el-table-column align="center" prop="cusName" label="客户姓名" width="130"></el-table-column>  
                <el-table-column align="center" prop="tasteProjectId" label="考察项目" :formatter="transformProject"></el-table-column>
                <!-- <el-table-column align="center" prop="companyName" label="签约店型"></el-table-column> -->
                <el-table-column align="center" prop="createTime" label="提交邀约时间" width="130"></el-table-column>
                <el-table-column align="center" prop="reserveTime" label="邀约来访时间" width="130"></el-table-column>
                <!-- <el-table-column align="center" prop="visitCity" label="来访城市"></el-table-column>  -->
                <el-table-column align="center" prop="province" label="预签约省份" width="100"></el-table-column> 
                <el-table-column align="center" prop="city" label="预签约城市" width="100"></el-table-column>   
                <el-table-column align="center" prop="district" label="预签约区／县" width="100"></el-table-column>
                <el-table-column align="center" prop="busGroupName" label="商务小组" width="100"></el-table-column> 
                <el-table-column align="center" prop="busSaleName" label="商务经理" width="120"></el-table-column>
                <el-table-column align="center" prop="teleGorupName" label="电销组" width="100"></el-table-column> 
                <el-table-column align="center" prop="teleSaleName" label="电销顾问" width="120"></el-table-column> 
                <el-table-column align="center" prop="createTime" label="创建时间" width="130"></el-table-column> 
                <el-table-column align="center" prop="notVisitReason" label="未到访原因"></el-table-column> 
            </el-table>
        </div>
        <!-- 驳回处理 -->
        <el-dialog title="提示" :visible.sync="dialogFormVisibleUnVisit" width="540px">
            <el-form :model="dialogForm" ref="dialogForm" :rules="dialogRules">
                <div class="fs16 marginB20">确定要将此 {{signRecordArrTitle}} 未到访记录驳回吗？</div>
                <el-form-item label="驳回原因：" label-width="100px" prop="reason">
                    <el-input
                        type="textarea"
                        :rows="4"
                        placeholder="请输入驳回原因"
                        maxLength="100"
                        v-model="dialogForm.reason">
                    </el-input>
                </el-form-item>
                <div class="f-tar">最多100字</div>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button type="primary" @click="submitDialogFormUnVisit('dialogForm')" :disabled="btnDisabled">确 定</el-button>
                <el-button @click="dialogFormVisibleUnVisit = false" >取 消</el-button>
            </div>
        </el-dialog>
    </el-row>
    <!-- 待审批未到访记录 end -->
    <!-- 待审批签约记录 -->
    <el-row>
        <div class="title">
            <div class="leftbox f-fl">待审批签约记录</div>
            <div class="rightbox f-fr">
                <img th:src="@{/images/icon_arrow.png}" alt="" class="f-fr">
                <span class="f-fr" @click="gotoSignRecord">进入客户签约记录</span>
                <el-button type="success" size="small" class="f-fr btn" @click="pass">审核通过</el-button>
                <el-button type="danger" size="small" class="f-fr btn" @click="OpenRejectSignRecordDialog">驳回</el-button>
            </div>
        </div>
        <div class="mainWhiteBg mainWhitePadding">
            <el-table 
                ref="dataTable4"
                tooltip-effect="dark"
                style="width: 100%"
                border
                 @selection-change="handleSelectionChange4"
                :data="dataTable4" 
                >
                <el-table-column align="center" type="selection" width="55"></el-table-column>
                <el-table-column align="center" prop="serialNum" label="序号" width="55"></el-table-column>
                <el-table-column align="center" prop="signNo" label="签约单编号" width="140"></el-table-column>
                <el-table-column align="center" prop="signType" label="签约类型" width="100" :formatter="getSignTypeText"></el-table-column>
                <el-table-column align="center" prop="createTime" label="签约时间" width="130"></el-table-column>
                <el-table-column align="center" prop="paymentDetails" label="付款明细" width="100">
                    <template slot-scope="scope">
                        <el-button @click="recordClick(scope.row)" type="text" size="small">查看明细</el-button>
                    </template>
                </el-table-column>
                <el-table-column align="center" prop="status" label="签约单状态"  width="100">
                    <template slot-scope="scope">
                        <span v-if="scope.row.status===0">
                            驳回&nbsp;<el-button @click="reasonClick(scope.row)" type="text">驳回原因</el-button>
                        </span>
                        <span v-else-if="scope.row.status===1">待审核                                    
                            <span v-if="scope.row.payType ==1">(全款)</span>
                            <span v-else-if="scope.row.payType ==2">(定金)</span>
                            <span v-else-if="scope.row.payType ==3">(追加定金)</span>
                            <span v-else-if="scope.row.payType ==4">(尾款)</span>
                        </span>
                        <span v-else-if="scope.row.status===2">有效               
                            <span v-if="scope.row.payType ==1">(全款)</span>
                            <span v-else-if="scope.row.payType ==2">(定金)</span>
                            <span v-else-if="scope.row.payType ==3">(追加定金)</span>
                            <span v-else-if="scope.row.payType ==4">(尾款)</span>
                        </span>                  
                    </template>
                </el-table-column>
                <el-table-column align="center" prop="customerName" label="客户姓名" width="130"></el-table-column>  
                <el-table-column align="center" prop="idCard" label="客户身份证号" width="100"></el-table-column> 
                <el-table-column align="center" prop="phone" label="客户联系电话" width="100"></el-table-column> 
                <el-table-column align="center" prop="signProjectName" label="签约项目" width="120"></el-table-column>   
                <el-table-column align="center" prop="signProvince" label="签约省份" width="100"></el-table-column>
                <el-table-column align="center" prop="signCity" label="签约城市" width="100"></el-table-column> 
                <el-table-column align="center" prop="signDictrict" label="签约区/县" width="100"></el-table-column>
                <el-table-column align="center" prop="businessGroupName" label="商务小组" width="100"></el-table-column> 
                <el-table-column align="center" prop="businessManagerName" label="商务经理" width="120"></el-table-column> 
                <el-table-column align="center" prop="teleGroupName" label="电销组" width="100"></el-table-column>
                <el-table-column align="center" prop="teleSaleName" label="电销顾问" width="120"></el-table-column>
                <el-table-column align="center" prop="amountReceivable" label="合同应收金额" width="80"></el-table-column>
                <!--<el-table-column align="center" prop="firstToll" label="路费"></el-table-column>-->
                <!--<el-table-column align="center" prop="preferentialAmount" label="优惠金额"></el-table-column>-->
            </el-table>
        </div>
        <!-- 驳回处理 -->
        <el-dialog title="提示" :visible.sync="dialogFormVisible" width="540px">
            <el-form :model="dialogForm" ref="dialogForm" :rules="dialogRules">
                <div class="fs16 marginB20">确定要将此{{signRecordArrTitle}} 签约单驳回吗？</div>
                <el-form-item label="驳回原因：" label-width="100px" prop="reason">
                    <el-input
                        type="textarea"
                        :rows="4"
                        placeholder="请输入驳回原因"
                        maxLength="100"
                        v-model="dialogForm.reason">
                    </el-input>
                </el-form-item>
                <div class="f-tar">最多100字</div>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button type="primary" @click="submitDialogForm('dialogForm')" :disabled="btnDisabled">确 定</el-button>
                <el-button @click="dialogFormVisible = false" >取 消</el-button>
            </div>
        </el-dialog>
        <!-- 驳回原因 -->
        <el-dialog title="驳回原因" :visible.sync="reasonDialog">           
            <div class="fs16 marginB20" >{{rebutReason}}</div>
        </el-dialog>
        <!-- 付款明细 -->
        <el-dialog title="付款明细" :visible.sync="recordDialog" width="950px">
            <div v-show="visitRecordShow" class="fs16 marginB20">签约单编号({{curRow.signNo}})付款明细以及付款绑定到访记录</div>
            <div v-show="paymentDetailsShow">
                <div class="fs16 marginB20">全款付款明细</div>
                <el-table ref="recordTable" tooltip-effect="dark" style="width: 100%;margin-bottom: 20px;" border :data="recordTable">
                    <el-table-column align="center" prop="statementNo" label="结算单编号"></el-table-column>
                    <el-table-column align="center" prop="payName" label="付款人姓名"></el-table-column>
                    <el-table-column align="center" prop="payMode" label="付款方式" :formatter="getPayModeText" width="80"></el-table-column>
                    <el-table-column align="center" prop="payTime" label="付款时间" :formatter="getTimeText" width="140"></el-table-column>
                    <el-table-column align="center" prop="amountReceived" label="实收金额" width="100"></el-table-column>
                    <el-table-column align="center" prop="amountEquipment" label="实收设备金额" width="110"></el-table-column>
                    <el-table-column align="center" prop="preferentialAmount" label="招商政策优惠金额" width="150"></el-table-column>
                    <el-table-column align="center" prop="firstToll" label="路费" width="150"></el-table-column>
                    <el-table-column align="center" prop="giveAmount" label="赠送金额" width="150"></el-table-column>
                    <el-table-column align="center" prop="giveType" label="赠送类型" width="150" :formatter="transGiveType"></el-table-column>
                    <el-table-column align="center" prop="amountPerformance" label="业绩金额" width="100"></el-table-column>
                    <el-table-column align="center" prop="status" label="明细状态" :formatter="getStatusText" width="100"></el-table-column>
                    <el-table-column align="center" prop="remarks" label="备注"></el-table-column>
                </el-table>
            </div>
            <div v-show="paymentDetailsShow2">
                <div class="fs16 marginB20">定金付款明细</div>
                <el-table
                    ref="recordTable2"
                    tooltip-effect="dark"
                    style="width: 100%;margin-bottom: 20px;"
                    border
                    :data="recordTable2"
                >
                    <el-table-column align="center" prop="statementNo" label="结算单编号"></el-table-column>
                    <el-table-column align="center" prop="payName" label="付款人姓名"></el-table-column>
                    <el-table-column align="center" prop="payMode" label="付款方式" :formatter="getPayModeText"
                                     width="80"></el-table-column>
                    <el-table-column align="center" prop="payTime" label="付款时间" :formatter="getTimeText"
                                     width="140"></el-table-column>
                    <el-table-column align="center" prop="amountReceived" label="实收金额" width="100"></el-table-column>
                    <el-table-column align="center" prop="amountEquipment" label="实收设备金额" width="110"></el-table-column>
                    <el-table-column align="center" prop="preferentialAmount" label="招商政策优惠金额" width="150"></el-table-column>
                    <el-table-column align="center" prop="firstToll" label="路费" width="150"></el-table-column>
                    <el-table-column align="center" prop="giveAmount" label="赠送金额" width="150"></el-table-column>
                    <el-table-column align="center" prop="giveType" label="赠送类型" width="150" :formatter="transGiveType"></el-table-column>
                    <el-table-column align="center" prop="amountPerformance" label="业绩金额" width="100"></el-table-column>
                    <el-table-column align="center" prop="amountBalance" label="余款金额" width="100"></el-table-column>
                    <el-table-column align="center" prop="makeUpTime" label="预计余款补齐时间" :formatter="getTimeText"
                                     width="140"></el-table-column>
                    <el-table-column align="center" prop="status" label="明细状态" :formatter="getStatusText"
                                     width="100"></el-table-column>
                    <el-table-column align="center" prop="remarks" label="备注"></el-table-column>
                </el-table>
            </div>
            <div v-show="paymentDetailsShow3">
                <div class="fs16 marginB20">二次定金付款明细</div>
                <el-table
                    ref="recordTable3"
                    tooltip-effect="dark"
                    style="width: 100%;margin-bottom: 20px;"
                    border
                    :data="recordTable3"
                >
                    <el-table-column align="center" prop="statementNo" label="结算单编号"></el-table-column>
                    <el-table-column align="center" prop="payName" label="付款人姓名"></el-table-column>
                    <el-table-column align="center" prop="payMode" label="付款方式" :formatter="getPayModeText"
                                     width="80"></el-table-column>
                    <el-table-column align="center" prop="payTime" label="付款时间" :formatter="getTimeText"
                                     width="140"></el-table-column>
                    <el-table-column align="center" prop="amountReceived" label="实收金额" width="100"></el-table-column>
                    <el-table-column align="center" prop="amountEquipment" label="实收设备金额" width="110"></el-table-column>
                    <el-table-column align="center" prop="preferentialAmount" label="招商政策优惠金额" width="150"></el-table-column>
                    <el-table-column align="center" prop="firstToll" label="路费" width="150"></el-table-column>
                    <el-table-column align="center" prop="giveAmount" label="赠送金额" width="150"></el-table-column>
                    <el-table-column align="center" prop="giveType" label="赠送类型" width="150" :formatter="transGiveType"></el-table-column>
                    <el-table-column align="center" prop="amountPerformance" label="业绩金额" width="100"></el-table-column>
                    <el-table-column align="center" prop="amountBalance" label="余款金额" width="100"></el-table-column>
                    <el-table-column align="center" prop="makeUpTime" label="预计余款补齐时间" :formatter="getTimeText"
                                     width="140"></el-table-column>
                    <el-table-column align="center" prop="status" label="明细状态" :formatter="getStatusText"
                                     width="100"></el-table-column>
                    <el-table-column align="center" prop="remarks" label="备注"></el-table-column>
                </el-table>
            </div>
            <div v-show="paymentDetailsShow4">
                <div class="fs16 marginB20">尾款付款明细</div>
                <el-table
                    ref="recordTable"
                    tooltip-effect="dark"
                    style="width: 100%;margin-bottom: 20px;"
                    border
                    :data="recordTable4"
                >
                    <el-table-column align="center" prop="statementNo" label="结算单编号"></el-table-column>
                    <el-table-column align="center" prop="payName" label="付款人姓名"></el-table-column>
                    <el-table-column align="center" prop="payMode" label="付款方式"
                                     :formatter="getPayModeText"></el-table-column>
                    <el-table-column align="center" prop="payTime" label="付款时间" :formatter="getTimeText"></el-table-column>
                    <el-table-column align="center" prop="amountReceived" label="实收金额"></el-table-column>
                    <el-table-column align="center" prop="amountEquipment" label="实收设备金额" width="110"></el-table-column>
                    <el-table-column align="center" prop="preferentialAmount" label="招商政策优惠金额" width="150"></el-table-column>
                    <el-table-column align="center" prop="firstToll" label="路费" width="150"></el-table-column>
                    <el-table-column align="center" prop="giveAmount" label="赠送金额" width="150"></el-table-column>
                    <el-table-column align="center" prop="giveType" label="赠送类型" width="150" :formatter="transGiveType"></el-table-column>
                    <el-table-column align="center" prop="amountPerformance" label="业绩金额"></el-table-column>
                    <el-table-column align="center" prop="status" label="明细状态" :formatter="getStatusText"></el-table-column>
                    <el-table-column align="center" prop="remarks" label="备注"></el-table-column>
                </el-table>
            </div>
            <div v-show="visitRecordShow">
                <div class="fs16 marginB20">关联到访记录</div>
                <el-table ref="recordTable" tooltip-effect="dark" style="width: 100%;margin-bottom: 20px;" border
                          :data="visitRecordTable">
                    <el-table-column align="center" prop="vistitTime" label="到访时间" width="140"></el-table-column>
                    <el-table-column align="center" prop="vistitStoreTypeName" label="到访店铺类型" width="120"></el-table-column>
                    <el-table-column align="center" prop="visitType" label="到访类型" width="90">
                        <template slot-scope="scope">
                            <div v-if="scope.row.visitType == 1">
                                预约来访
                            </div>
                            <div v-else-if="scope.row.visitType == 2">
                                慕名来访
                            </div>
                            <div v-else-if="scope.row.visitType == 3">
                                临时来访
                            </div>
                        </template>
                    </el-table-column>
                    <el-table-column align="center" prop="arrVisitCity" label="到访城市"></el-table-column>
                    <el-table-column align="center" prop="createTime" label="创建时间" width="140"></el-table-column>
                    <el-table-column align="center" prop="visitNum" label="到访次数" :formatter="transVisitNum"
                                     width="90"></el-table-column>
                    <el-table-column align="center" prop="status" label="到访有效性" :formatter="getStatusText"
                                     width="100"></el-table-column>
                </el-table>
            </div>
            <div v-show="showbutton" slot="footer" class="dialog-footer f-tac">
                <template>
                    <shiro:hasPermission name=" aggregation:signRecord:reject">
                        <el-button type="primary" @click="rebutOne">驳回</el-button>
                    </shiro:hasPermission>
                    <shiro:hasPermission name=" aggregation:signRecord:pass">
                        <el-button type="success" @click="passOne">审核通过</el-button>
                    </shiro:hasPermission>
                </template>
            </div>
        </el-dialog>
    </el-row>
    <!-- 待审签约记录 end-->
    
</div>

<!-- import common js-->
<div th:include="_footer_include :: #jsLib"></div>
<script th:inline="javascript"> 
// 待分配邀约来访记录
var busSaleList=[[${busSaleList}]];//商务总监
var projectList=[[${projectList}]];//项目
var optionAddressList=[[${optionAddressList}]];//选址情况
var storefrontAreaList=[[${storefrontAreaList}]];//店铺面积
var ussmList=[[${ussmList}]];//投资金额
var giveTypeList =[[${giveTypeList}]];
var payModeItem =[[${payModeItem}]];

</script>
<script th:src="@{/js/custom/console/consoleBusinessMajordomo.js}"></script>
</body>
</html>